package com.tsugun.mediaplayer.model.database

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

import com.tsugun.mediaplayer.R

/**
 * 数据库工具类
 * Created by shize on 2017/5/26.
 */

class DBOpenOperator(private val mContext: Context, name: String, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(mContext, name, factory, version) {

    override fun onCreate(db: SQLiteDatabase) {
        db.execSQL(mContext.getString(R.string.sql_table_favorite))
        db.execSQL(mContext.getString(R.string.sql_table_follow))
        db.execSQL(mContext.getString(R.string.sql_table_download))
        db.execSQL(mContext.getString(R.string.sql_table_lately))
        db.execSQL(mContext.getString(R.string.sql_table_sheet))
        db.execSQL(mContext.getString(R.string.sql_table_play_list))
    }

    override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {

    }
}
